package com.yjd.comm.borrow.service;

import java.util.List;

import com.yjd.comm.activity.model.CommonOrderModel;
import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.borrow.model.RaiseInterestVolumeModel;

/**
 * <b>description</b>：加息券表业务接口<br>
 * <b>time</b>：2015-05-11 09:15:34 <br>
 * <b>author</b>： ready likun_557@163.com
 */
public interface IRaiseInterestVolumeService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public RaiseInterestVolumeModel insert(RaiseInterestVolumeModel model) throws Exception;

	/**
	 * 批量插入
	 * 
	 * @param models
	 * @throws Exception
	 */
	public void inserts(List<RaiseInterestVolumeModel> models) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(RaiseInterestVolumeModel model) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(Long id) throws Exception;

	/**
	 * 获取用户在某个标的中可用的加息券
	 * 
	 * @param user_id
	 * @param borrow_id 
	 * @param curtime
	 * @return
	 * @throws Exception
	 */
	public List<RaiseInterestVolumeModel> getAvailableRaiseInterestVolumes(Long user_id,
			Long borrow_id) throws Exception;
	
	public void insertRaiseInterestVolumeByOrder(CommonOrderModel model)
			throws Exception;

}
